<template>
  <div>
    <el-dropdown @command="handleCommand" size="small">
      <el-button type="primary" size="mini">
        功能
        <i class="el-icon-arrow-down el-icon--right"></i>
      </el-button>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item command="info">详情</el-dropdown-item>
        <el-dropdown-item command="update">提交</el-dropdown-item>
        <el-dropdown-item command="edit">编辑</el-dropdown-item>
        <el-dropdown-item command="del">删除</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
    <detail ref="datailId" :datarow="datarow"></detail>
  </div>
</template>
<script>
import detail from "./detail";
export default {
  components: { detail },
  props: {
    datarow: {
      type: Object,
      default: null
    }
  },
  name: "dotag",
  data() {
    return {};
  },
  methods: {
    handleCommand(v) {
      console.log(v);
      console.log(this.datarow);
      if (v === "info") {
        this.info();
      }
    },
    info() {
      const _this = this.$refs.datailId;
      _this.dialog = true;
    }
  }
};
</script>
<style lang="scss">
</style>
